import Vue from 'vue'
import VueRouter from 'vue-router'

import Home from '../views/Home.vue'
import Login from '../views/Login.vue'
import City from '../views/City.vue'
import DramaDetail from '../views/Drama/_id.vue'
import HomeList from '../views/Home/HomeList.vue'
import DramaList from '../views/Home/DramaList.vue'
import Center from '../views/Home/Center.vue'

Vue.use(VueRouter)

const router = new VueRouter({
  routes: [
    {
      path: '/',
      component: Home,
      children: [
        {
          path: 'home',
          component: HomeList,
          meta: {
            tabIndex: 0
          }
        },
        {
          path: 'dramas',
          component: DramaList,
          meta: {
            tabIndex: 1
          }
        },
        {
          path: 'center',
          component: Center,
          meta: {
            tabIndex: 2
          }
        },
        {
          path: '',
          redirect: '/home'
        }
      ]
    },
    {
      path: '/city',
      name: 'city',
      component: City
    },
    {
      path: '/login',
      component: Login
    },
    {
      path: '/drama/:dramaId',
      component: DramaDetail
    }
  ]
})

export default router
